﻿<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true"
    Inherits="Register" Title="Opret bruger" CodeBehind="Register.aspx.cs" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="NavPlaceholder" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="MainPlaceHolder" runat="Server">
    <div id="notLoggedInContainer" runat="server">
        <asp:Label ID="registerLabel" runat="server" Text=""></asp:Label>
        <br />
        <asp:Panel ID="createUserPanel" DefaultButton="createUserButton" runat="server">
            <div id="createUserContainer">
                <div>
                    <asp:Label ID="userExistsLabel" runat="server" Text="" Style="color: Red"></asp:Label>
                </div>
                <div>
                    <div>
                        Brugernavn:
                    </div>
                    <span>
                        <asp:TextBox ID="createUsernameText" runat="server" AutoCompleteType="Disabled">
                        </asp:TextBox>
                        <asp:RequiredFieldValidator ID="validateUsername" ControlToValidate="createUserNameText"
                            runat="server" ErrorMessage="Brugernavn mangler"></asp:RequiredFieldValidator>
                    </span>
                </div>
                <div>
                    <div>
                        Email:
                    </div>
                    <span>
                        <asp:TextBox ID="emailText" runat="server" AutoCompleteType="Disabled">
                        </asp:TextBox>
                        <asp:RegularExpressionValidator ID="validateEmail" runat="server" ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"
                            ControlToValidate="emailText" ErrorMessage="Email er ikke gyldig"></asp:RegularExpressionValidator>
                    </span>
                    <div>
                    </div>
                </div>
                <div>
                    <div>
                        Password:
                    </div>
                    <span>
                        <asp:TextBox ID="createPasswordText" TextMode="Password" runat="server" AutoCompleteType="Disabled">
                        </asp:TextBox>
                        <asp:RequiredFieldValidator ID="validatePassword" runat="server" ControlToValidate="createPasswordText"
                            ErrorMessage="Password mangler"></asp:RequiredFieldValidator>
                    </span>
                </div>
                <div>
                    <div>
                        Gentag password:
                    </div>
                    <div>
                        <asp:TextBox ID="confirmPasswordText" TextMode="Password" runat="server" AutoCompleteType="Disabled">
                        </asp:TextBox>
                    </div>
                    <br />
                    <br />
                    <span>
                        <asp:CompareValidator ID="comparePasswords" runat="server" ControlToCompare="createPasswordText"
                            ControlToValidate="confirmPasswordText" ErrorMessage="Dit password er ikke skrevet ens i de 2 felter" />
                    </span>
                </div>
            </div>
            <br />
            <div class="button">
                <asp:Button ID="createUserButton" runat="server" Text="Opret bruger" OnClick="createUserButton_Click" />
            </div>
        </asp:Panel>
    </div>
    <div id="loggedInContainer" runat="server">
        <asp:Panel ID="Panel1" runat="server" DefaultButton="saveChangesButton">
            <div>
                <div>
                    Ændre password:
                </div>
                <span>
                    <asp:TextBox ID="changePassword1" TextMode="Password" runat="server" AutoCompleteType="Disabled">
                    </asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="changePassword1"
                        ErrorMessage="Password mangler"></asp:RequiredFieldValidator>
                </span>
            </div>
            <div>
                <div>
                    Gentag nyt password:
                </div>
                <div>
                    <asp:TextBox ID="changePassword2" TextMode="Password" runat="server" AutoCompleteType="Disabled">
                    </asp:TextBox>
                </div>
                <br />
                <br />
                <span>
                    <asp:CompareValidator ID="CompareValidator1" runat="server" ControlToCompare="changePassword2"
                        ControlToValidate="confirmPasswordText" ErrorMessage="Dit password er ikke skrevet ens i de 2 felter" />
                </span>
            </div>
            <asp:Button ID="saveChangesButton" runat="server" Text="Gem ændringer" 
                onclick="saveChangesButton_Click" />
                <br />
        </asp:Panel>
    </div>
</asp:Content>
